interface OptionState {
    len: number
}

interface OptionsModel {
    state: OptionState,
    reducers: {
        setLen: (state: OptionState, action?: { payload: number }) => void,
        getLen: (state: OptionState) => number
    }
}

const optionsModel: OptionsModel = {
    state: {
        len: 20,
    },
    reducers: {
        setLen(state, action) {
            return { ...state, len: action?.payload }
        },
        getLen(state) {
            return state.len
        }
    }
}
export default optionsModel
